<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	 <title>w1002</title>
	 <script>
	 window.onload=function(){
		
	var showTime=function(){  
		var d="<h3>"+new Date().toLocaleTimeString()+"</h3>";		
	  document.getElementById("s02").innerHTML=d;
	};		
		
	//window.setTimeout(showTime,1000); 일정시간뒤에 한번한호출
	
	//일정시간간격으로 반복호출
	var t=window.setInterval(showTime,1000);
		
		//Timer끄기
		document.getElementById("s03").onclick=function(){
			//clearInterval(t);
			setTimeout(function(){ clearInterval(t);  },3000);
		};
		
	 };//end of window.onload
	</script>
	</head>
	<body>	
		<span id="s01" onclick="self.close();">창닫기</span> |
		<span id="s03">3초뒤에 Timer끄기</span>
		<div id="s02"></div>	
	</body>
</html>













